<%@ page language="java" import="com.test.bean.*" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
	Book book = new Book();
	session.setAttribute("book", book);
	%>
	<%-- <jsp:useBean id="book" class="com.test.bean.Book" scope="session"></jsp:useBean> --%>

	<jsp:setProperty property="*" name="book" />
	<jsp:useBean id="book2" class="com.test.bean.Book" scope="request"></jsp:useBean>
	<jsp:setProperty property="id" value="2" name="book2" />
	<jsp:setProperty property="bookCode" param="bCode" name="book2" />
	<jsp:setProperty property="bookName" param="bName" name="book2" />
	<jsp:setProperty property="bookTotal" param="bTotal" name="book2" />
	<%
	int num = 20;
	%>
	<jsp:setProperty property="lendNum" value="<%=num%>" name="book2" />
	<%-- 查看结果 --%>
	<jsp:getProperty property="id" name="book2" /><br> 
	Session范围内<br> 
	id:<%=book.getId()%><br> 
	ISBN:<%=book.getBookCode()%><br>
	bookName:<%=book.getBookName()%><br> 
	bookTotal:<%=book.getBookTotal()%><br>
	lendNum:<%=book.getLendNum()%><br> 
	Request范围内<br> 
	id:<%=book2.getId()%><br> 
	ISBN:<%=book2.getBookCode()%><br>
	bookName:<%=book2.getBookName()%><br> 
	bookTotal:<%=book2.getBookTotal()%><br>
	lendNum:<%=book2.getLendNum()%><br>

</body>
</html>